{% extends "../base.html" %}
{% load static %}
{% block css %}
    <link rel="stylesheet" href="{% static "testcase/apicase.css" %}">
{% endblock %}
{% block main%}
    <div class="model">
    <span>模块</span>
    <hr>
    {% for model in models %}
    <p id="model{{ model.id }}" class="{% if modelid == model.id %}ismodel{% endif %}">{{ model.name }}</p>
    {% endfor %}
    </div>
    <div class="search"><label>
        <input name="search" placeholder="搜索条件">
    </label><span class="icon iconfont" title="搜索">&#xe62f;</span></div>
    <button class="add" title="添加">添加</button>
    <div class="head-list">
    <span>名称</span>
    <span>描述</span>
    <span>IP</span>
    <span>端口</span>
    <span>方法类型</span>
    <span>路径</span>
    <span>参数</span>
    <span>请求体</span>
    <span>预期结果</span>
    <span>操作</span>
    </div>
    <hr>
    {% for case in cases %}
        <div class="data-list" id="{{ case.id }}">
            <label>
                <input value="{{ case.title }}" readonly>
            </label>
            <label>
                <input value="{{ case.desc }}" readonly>
            </label>
            <label>
                <input value="{% if case.host  %} {{ case.host }} {% else %}{% endif %}" readonly>
            </label>
            <label>
                <input value="{% if case.port  %} {{ case.port }} {% else %}{% endif %}" readonly>
            </label>
            <label>
                <select title="method">
                    <option value="GET" {% if case.method == 'GET' %} selected {% endif %}>GET</option>
                    <option value="POST" {% if case.method == 'POST' %} selected {% endif %}>POST</option>
                    <option value="PUT" {% if case.method == 'PUT' %} selected {% endif %}>PUT</option>
                    <option value="DELETE" {% if case.method == 'DELETE' %} selected {% endif %}>DELETE</option>
                    <option value="HEAD" {% if case.method == 'HEAD' %} selected {% endif %}>HEAD</option>
                    <option value="OPTIONS" {% if case.method == 'OPTIONS' %} selected {% endif %}>OPTIONS</option>
                    <option value="CONNECT" {% if case.method == 'CONNECT' %} selected {% endif %}>CONNECT</option>
                    <option value="TRACH" {% if case.method == 'TRACH' %} selected {% endif %}>TRACH</option>
                </select>
            </label>
            <label>
                <input value="{% if case.path  %} {{ case.path }} {% else %}{% endif %}" readonly>
            </label>
            <label>
                <input value="{{ case.para }}" readonly>
            </label>
            <label>
                <input value="{{ case.body }}" readonly>
            </label>
            <label>
                <input value="{{ case.result }}" readonly>
            </label>
            <span class="icon iconfont options edit " title="编辑">&#xe609;</span>
    {#        <span class="icon iconfont options" title="增加">&#xe657;</span>#}
            <span class="icon iconfont options del" title="删除">&#xe629;</span>
            <span class="icon iconfont options dis" title="显示">&#xe601;</span>
        </div>
    {% endfor %}
    <div class="add_case" style="display: block">

    </div>
{% endblock %}
{% block js%}
    <script src="{% static "testcase/apicase.js" %}"></script>
{% endblock %}
